class Cache_fib_deco:

    def __init__(self, func):
        self.func = func
        self.cache_dict = {}


    def __call__(self, *args):
        if args not in self.cache_dict:
            self.cache_dict[args] = self.func(*args)
        return self.cache_dict[args]


@Cache_fib_deco
def fib_2(n):
    a, b = 0, 1
    for _ in range(n):
        a, b = b, a + b
    return a


print(fib_2(3))